import http from "@/plugins/aixos";

export function findAllPlan(args: Record<string, any>) {
  const url =
    "/plan?" +
    Object.entries(args)
      .map(([key, value]) => `${key}=${value}`)
      .join("&");
  return http.request<PlanModel[]>({
    url,
    method: "GET",
  });
}

export function findPlan(id: number) {
  return http.request<PlanModel>({
    url: `/plan/${id}`,
    method: "GET",
  });
}

export function delPlan(id: number) {
  return http.request({
    url: `/plan/${id}`,
    method: "DELETE",
  });
}
